package com.dic;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.transaction.Transactional;
import java.text.SimpleDateFormat;
import java.util.Date;

@RestController
public class Hello {

    @PersistenceContext
    private EntityManager entityManager;

    @RequestMapping("/hello")
    @Transactional
    public String a (){
        User t = new User();
        t.setName("小米12");
        entityManager.persist(t);
        return "成功";
    }


    
}
